@extends("Admin.layout.layout")
@section("title","修改话题")
@section("con")
	<div class = "row">
	<div class = "col-md-6 col-md-offset-3" >
		<form action = "/admin/topic/update" id = "form" method = "post" enctype= "multipart/form-data">
			父级话题
			<input class="form-control"  type = "text"  name = "topic_name" @if($res->pid !=0)readonly  value = "{{$res1->topic_name}}" @else value = "{{$res->topic_name}}" @endif>
			<br />
			@if($res->pid!=0)
			<input class="form-control" placeholder="子话题" type = "text" value="{{$res->topic_name}}" name = "topic_name">
			</br>
				<textarea class="form-control" placeholder="话题描述" type = "text" name = "topic_summary">{{$res->topic_summary}}</textarea>
				</br>
				话题图标:
				<input type = "file"  name = "topic_portrait" id = "topic_portrait"/>
				<img src="{{$res->topic_portrait}}" />
				<div id = "preview"></div>
				<input type = "hidden" name = "id" value = "{{$res->id}}" />
			@endif
			{{csrf_field()}}
			<div class = "col-md-offset-5">
				<button type="submit" id = "button" class="btn btn-success">修改话题</button>
			</div>
		</form>
	</div>
</div>
<script>
	// function showorhidden()
	// {
	// 	var value = document.getElementsByTagName("select")[0].value;
	// 	if(value == 0)
	// 	{
	// 		document.getElementById("desc").style.display = "none";
	// 		document.getElementById("desc1").style.display = "none";
	// 	}
	// 	else
	// 	{
	// 		document.getElementById("desc").style.display = "block";
	// 		document.getElementById("desc1").style.display = "block";
	// 	}
	// }
</script>
@endsection